package exam.nio.T3;

import java.util.*;

public class Main {

    public static int n;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int total = 0;
        for (int i=0; i<n; ++i) {
            int x = sc.nextInt();
            total += solution(x);
        }
        System.out.println(total);
    }

    private static int solution(int x) {
        String s = String.valueOf(x);
        int num = 0;
        for (int i=0; i<s.length(); ++i) {
            if (s.charAt(i) == '0')
                num++;
        }
        return s.length() - num;
    }
}